import React from 'react';
import {
    View,
    Text,
    Navigator,
    TouchableOpacity,
    FlatList,
    Slider,
    ToastAndroid,
    ActivityIndicator,
    WebView,
    ScrollView
} from 'react-native';
import { styles } from '../../styles';
import SecondPageComponent from '../secondComponent/SecondPageComponent';

export default class FourPageComponent extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
          fist:1
        };
    }
    componentDidMount() {
      // alert(JSON.stringify(styles));

    }
    childMethod() {
      const { navigator } = this.props;
      //为什么这里可以取得 props.navigator?请看上文:
      //<Component {...route.params} navigator={navigator} />
      //这里传递了navigator作为props
      if(navigator) {
          navigator.push({
              name: 'SecondPageComponent',
              component: SecondPageComponent,
          })
      }
    }
    _pressButton() {
        const { navigator } = this.props;
        //为什么这里可以取得 props.navigator?请看上文:
        //<Component {...route.params} navigator={navigator} />
        //这里传递了navigator作为props
        if(navigator) {
            navigator.push({
                name: 'SecondPageComponent',
                component: SecondPageComponent,
            })
        }
    }
    render() {
        let { position } = this.props;
        return (
            <View style={styles.flexColumn}>
              <View style={styles.apiheader}><Text style={styles.apiheaderFont}>React Native API</Text></View>
              <ScrollView style={styles.apiContent}>
                <View><Text>11</Text></View>
              </ScrollView>
          </View>
        );
    }
}
